import {defineConfig} from 'vitepress'
import {containerPreview, componentPreview} from '@vitepress-demo-preview/plugin'
import {fileURLToPath, URL} from "node:url";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "vicky web components",
  description: "vicky practice components",
  base:'/dist/',
  vite: {
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('../../src', import.meta.url))
      }
    },
  },
  markdown: {
    config(md) {
      md.use(containerPreview)
      md.use(componentPreview)
    }
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      {text: 'Home', link: '/'},
      {text: 'Examples', link: '/components/button'},
      {text: 'test', link: '/api-examples'}
    ],
    sidebar: {
      '/components':[
        {
          text: 'Basic 基础组件',
          items: [
            {text: 'Button', link: '/components/button'},
            {text: 'Switch', link: '/components/switch'},
            {text: 'Input', link: '/components/input'}
          ]
        }
      ],
      '/api-examples':[
        {
          text:'登录功能',
          items:[
            {text:'获取验证码',link:'/components/button'}
          ]
        }
      ]
    },

    socialLinks: [
      {icon: 'github', link: 'https://github.com/vuejs/vitepress'}
    ]
  }
})
